<include file="./Tpl/Home/top.html"/>
<include file="./Tpl/Home/header.html" />
<!--交易页面的子导航区-->
<include file="./Tpl/Home/user_nav.html" />

<div class="container">
<!--全站交易记录-->
<div class="trade-part trade-part-hd mt20">
  <div class="trade-hd">
        <h5><i class="icon_condition"></i>财富币回购</h5>
  </div>
  <div class="md">
    <div class="my-grid" id="order-grid" style="margin-bottom:20px;">
	    <form action="{$path}/User/hg" method="post" id="formid">
		    <input type="hidden" name="buyid" value="{$buyid}"/>
			<input type="hidden" name="issueid" value="{$issueid}"/>
			<table class="items table table-striped table-bordered table-condensed chkreal">
			<tbody>
			<tr><td>回购价格：</td><td><input type="text" name="price" value="{$price}" readonly/></td></tr>
			<tr><td>回购限量：</td><td><input type="text" name="nownum" value="{$nownum}" readonly/></td></tr>
			<tr><td>回购数量：</td><td><input type="text" name="num" placeholder="{$huigoud}--{$huigouu}个之间"/></td></tr>
			<tr><td>验证码：</td><td><input type="text" name="code" placeholder="请输入验证码" style="width:114px;"/><img id="refresh" style="vertical-align:middle;height:30px;margin-left:5px;" onclick="document.getElementById('refresh').src='{$path}/Login/checkcode/t/'+Math.random()" src="{$path}/Login/checkcode/" title="看不清？点一下"/></td></tr>
			<tr><td colspan=2><input type="button" id="subbtn" class="btn" value="确定"/></td></tr>
			</tbody>
			</table>
		</form>
	</div>
	<div class="my-grid" id="order-grid">
		<table class="items table table-striped table-bordered table-condensed saferoom">
		<thead>
		<tr><th>数量</th><th>价格</th><th>总额</th><th>时间</th><th width="10%">状态</th></tr>
		</thead>
		<tbody>
		<volist name="list" id="vo" empty="$empty">
		<tr><td class="chkTit">{$vo.num|default='0'}</td><td>{$vo.price|default='0'}</td><td>{$vo.total|default='0'}</td><td>{$vo.addtime|default='无'}</td><td><eq name="vo.status" value="0">未回购<else/>已回购</eq></td></tr>
		</volist>
		</tbody>
		</table>
	</div>
  </div>
</div>
</div>
<!--尾部-->
<include file="./Tpl/Home/footer.html" />
<!-- footer -->

<div class="modal hide fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>

<!--[if IE 6]><script src="/js/ie-6.js"></script><![endif]-->
<script type="text/javascript" src="/Public/Home/js/jquery.SuperSlide.js"></script>
<script type="text/javascript" src="/Public/Home/js/slideTxtBox.js"></script>
<script type="text/javascript" src="/Public/Home/js/bootbox.js"></script>
<script type="text/javascript" src="/Public/Home/js/box.js"></script>
<script type="text/javascript" src="/Public/Home/js/lang.js"></script>
<script type="text/javascript" src="/Public/Home/js/responseHandler.js"></script>
<script type="text/javascript" src="/Public/Home/js/jquery.yiigridview.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
jQuery('body').popover({'selector':'a[rel=popover]'});
jQuery('#order-grid').yiiGridView({'ajaxUpdate':['order-grid'],'ajaxVar':'ajax','pagerClass':'pagination','loadingClass':'grid-view-loading','filterClass':'filters','tableClass':'items table table-striped table-bordered table-condensed','selectableRows':1,'enableHistory':false,'updateSelector':'{page}, {sort}','filterSelector':'{filter}','pageVar':'CurrencyTransaction_page'});
});
/*]]>*/

$(document).ready(function(){
	$('#subbtn').click(function(){
	    var num = $('input[name=num]').val();
	
	    if(num=="" || num <= 0){
		    msgDalog("请输入回购数量！","",0);
		}else if(isNaN(num)){
			msgDalog('回购数量应为数字！');
			$('input[name=goldnum]').val('');
			return false;
		}else if(num >{$nownum}){
            msgDalog('回购限量在 {$nownum}之内！');
            $('input[name=goldnum]').val('');
            return false;
        }else if(num < {$huigoud}||num > {$huigouu}){
            msgDalog('回购数量应在{$huigoud}--{$huigouu}个之间！');
            $('input[name=goldnum]').val('');
            return false;
        }else if($('input[name=code]').val()==""){
		    msgDalog("请输入验证码！","",0);
		}else{
		    var pos = num.indexOf('.');
			if(pos != -1){
				if(num.substring(0,pos)=='') {
					msgDalog('回购数量不合法！');
					return false;
				}
				len = num.substring(pos+1,num.length);
				if(len.length > 8) {
					msgDalog('回购数量小数位数不能超过8位！');
					return false;
				}
			}else{
		        $('#formid').submit();
			}
		}
	});
});
</script>
</body>
</html>